<?php
error_reporting(0);
require_once ('config.php');
?>

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>登录</title>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="global.css" type="text/css"/>

<style type="text/css">
.message-box{
width:88%;
margin-top:6%;
}
body{
padding-bottom:20px;
}
label{
display:block;
text-align:center;
font-size:14px;
padding:5px;
margin:auto;
width:60px;
}
hr{
margin:8px;
}
.title-img{
height:25px;
width:auto;
margin-bottom:-10px;
}
.ex-btn{
display:inline-block;
padding:8px;
}
.container{
display:block;
width:100%;
}
.message-box .btn{
float:none;
margin:auto;
margin-top:15px;
margin-bottom:10px;
}
a{
color:#fe6565;
display:inline-block;
position:static;
}
#wexin-login-btn{
margin-bottom:10px;
}
.message-box .content{
max-height:none;
margin-bottom:5px;
margin-top:5px;
}
.circle-icon{
width:18px;
height:18px;
border-radius:9px;
background-color:#F0BEE0;
}
.circle-icon span{
color:white;
}
.hint-box{
font-size:small;
}
input{
text-align:center;
}
p{
font-size:14px;
}
a{
font-size:14px;
}
#area-select{
cursor:pointer;
width: 186px;
text-align: center;
color: #444;
background-color: #fff;
background-size: auto 15px;
padding: 8px;
border-radius: 8px;
border: 1px solid #ddd;
}
</style>
<script type="text/javascript">
var True = true
var False = false
var None = null
window.dataObj = {'root_uri': '/', 'area': 'hust'}
</script>

</head>
<body>
<?php

if($_GET['flag']== ''){
?>
<?php
if($_POST["submit2"]){
$name=$_POST['name'];
$pw=($_POST['password']);
$sql="select * from d_user where d_user_name='".$name."'"; 
$result=mysql_query($sql) or die("error");
$num=mysql_num_rows($result);
if($num==0){
  echo "<script>alert('账号不存在');location='index.php';</script>";
  }
while($rs=mysql_fetch_object($result))
{
  if($rs->d_user_pass!=$pw)
  {
    echo "<script>alert('密码错误');location='index.php';</script>";
    mysql_close();
  }
  else 
  {
    $_SESSION['d_user']=$_POST['name'];
    header("Location:member.php");
    mysql_close();
    }
  }
}
}
?>
<div id="login-box" class="message-box" >
<header class="fruit-bg-header"></header>
<div class="content" >
	<section class="container" >
		<form action="" method="post" name="regform" onSubmit="return Checklogin();" style="margin-bottom:0px;">
			<label >用户名</label>
			<input name="name" type="text" id="name" placeholder="请输入账号">
			<label >密码</label>
			<input name="password" type="password" id="pass" placeholder="请输入密码"></br>
			<input name="submit2" type="submit" value="登录" class="btn" style="font-family: 微软雅黑"/>
		</form>
    <a href='regi.php'>我要注册</a>
	<section class="container" >
</body>
</html>
